
package cn.stylefeng.guns.sys.modular.system.controller;

import cn.stylefeng.guns.base.pojo.page.LayuiPageFactory;
import cn.stylefeng.guns.sys.modular.system.service.SiteService;
import cn.stylefeng.roses.core.base.controller.BaseController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @author YuJiBiao
 * @version: 1.0
 * @Date 2020/7/8 16:30
 **/
@Controller
@RequestMapping("/site")
public class SiteController extends BaseController {

    @Autowired
    SiteService siteService;

    private String PREFIX = "/modular/system/site/";



    @RequestMapping("/list")
    @ResponseBody
    public Object list() throws Exception {
        //获取分页参数
        Page page = LayuiPageFactory.defaultPage();

        Page<Map<String, Object>> mapPage = siteService.selectKmsList();
        return LayuiPageFactory.createPageInfo(mapPage);
    }

    /**
     *
     *
     * @author fengshuonan
     * @Date 2018/12/23 4:56 PM
     */
    @RequestMapping("")
    public String index() {
        return PREFIX + "site.html";
    }

    /**
     *
     *
     * @author fengshuonan
     * @Date 2018/12/23 6:30 PM
     */
    @RequestMapping(value = "/site_add")
    public String roleAdd() {
        return PREFIX + "/site_add.html";
    }

}
